import { setStorageExpire, getStorageExpire, validateEmail, validatePhone,isLogin } from './utils'

const plugin = {};
plugin.install = (Vue, options) => {
	
	Vue.prototype.$setStorageExpire = setStorageExpire
	Vue.prototype.$getStorageExpire = getStorageExpire
	Vue.prototype.$validateEmail = validateEmail
	Vue.prototype.$validatePhone = validatePhone
	Vue.prototype.$isLogin = isLogin
	
	// 重写setTimeout
	Vue.prototype.$settimeout = (fn, duration = 800) => {
		if(typeof fn === 'function'){
			setTimeout(fn, duration)
		}
	}
};

export default plugin